<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>{{'admin|admin_site_name'|C|default:'管理后台登录'}}</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">
<script src="{{$smarty.const.__SHARE__}}js/jquery-1.8.3.min.js" type="text/javascript"></script>
{{include file="{{$smarty.const.PLUG}}killie/killie.html"}}
<script src="{{$smarty.const.__SHARE__}}js/jquery.cookie.min.js" type="text/javascript"></script>
{{include file="{{$smarty.const.PLUG}}bootstrap/bootstrap.html"}}
<link href="{{$smarty.const.__APP__}}style/app.css" rel="stylesheet" type="text/css" />
{{include file="{{$smarty.const.PLUG}}colorbox/colorbox.html"}}
<style>
@-webkit-keyframes surround{
	0%,100%   {-webkit-transform:translate3d(0,0,0);}
	25%   {-webkit-transform:translate3d(-5%,0,0) scale3d(1.1,1.1,1);}
	50%   {-webkit-transform:translate3d(-5%,-5%,0) scale3d(1.2,1.2,1);}
	75%   {-webkit-transform:translate3d(0,-5%,0) scale3d(1.1,1.1,1);}
}
@-moz-keyframes surround{
	0%,100%   {-moz-transform:translate3d(0,0,0);}
	25%   {-moz-transform:translate3d(-5%,0,0) scale3d(1.1,1.1,1);}
	50%   {-moz-transform:translate3d(-5%,-5%,0) scale3d(1.2,1.2,1);}
	75%   {-moz-transform:translate3d(0,-5%,0) scale3d(1.1,1.1,1);}
}
.background{
	width:100%;
	height:100%;
	top:0;
	left:0;
	background: url('{{$smarty.const.__APP__}}images/background/bg_{{'admin|login_background'|C|default:1}}.jpg') no-repeat scroll center bottom #528036;
	position: absolute;
	-webkit-animation: surround 60s infinite;
	-moz-animation: surround 60s infinite;
}
body{
	overflow: hidden;
}
.form-signin {
	position:absolute;
	top:50%;
	left:50%;
	margin:-205px 0 0 -220px;
	width:277px;
	*width:270px;
	padding: 20px 80px 35px;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 5px;
	box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.input-prepend{
	line-height:40px;
	height:40px;
}
.input-prepend .add-on,.input-prepend input{
	height:25px;
	line-height:25px;
}
.input-prepend .span2{
	*margin-top:-1px;
}
.message{
	color: tomato;
    font-size: 12px;
    margin-top: 10px;
    position: absolute;
    text-align: center;
    width: 275px;
}
</style>
<script>
/**
 * login function
 */
function login(){
	var username = $("#username").val();
	var password = $("#password").val();
	var verify = $("#verify").val();

	$("#msg").css("display", "block");
	$("#msg").html("正在登录中，请稍等...");
	$.post("index.php?app=public&act=login", {username: username, password: password, verify: verify},
		function(obj){
			if(obj.statusCode == 200){
				$("#msg").html(obj.message);//syslogin
				if('{{$smarty.get.url}}'=='') var url = "{{$smarty.const.__ROOT__}}";
				else var url = '{{$smarty.get.url}}'; 
				document.location.href = url;//登录后跳转页面
			}else{
				$("#msg").html(obj.message);
				$("#verifyCodeImg").click();
				$("#verify").val("");
			}
		}
	,'json');
	//将当前登录用户名记cookie
  	$.cookie('username',$('input[name=username]').val());
}

$(function(){
	$("#username").keyup(function(event){
		if(event.keyCode == 13) $("input[name='password']").focus();
	}); 
	
	$("#password").keyup(function(event){
		if(event.keyCode == 13) $("input[name='verify']").focus();
	}); 
	
	$("#verify").keyup(function(event){
		if(event.keyCode == 13)	login();
 	});

	//读取cookie
	$('#username').val($.cookie('username'));
});
</script>
<script>
$(function(){
    $('.qq').click(function(event){
    	window.open('{{$qq_url}}','','width=600,height=600,left=10, top=10,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');
    });
});
</script>
</head>
<body>
<div class="background"></div>
<form class="form-signin">
	<h3 class="fonts19 fontwn" style="margin:10px 0 13px;">
		管理后台登录
	</h3>
	<div class="input-prepend">
		<span class="add-on">用户名 :</span>
		<input style="width:200px;" class="span2" type="text" id="username" name="username" placeholder="输入用户名">
	</div>
	<div class="input-prepend">
		<span class="add-on">密　码 :</span>
		<input style="width:200px;" class="span2" type="password" id="password" name="password" placeholder="输入密码">
	</div>
	<div class="input-prepend input-append">
		<span class="add-on">验证码 :</span>
		<input style="width:90px;" id="verify" name="verify" class="span2" type="text" placeholder="验证码">
		<span class="add-on"><img style="_width:100px;_height:30px;max-width:100px;max-height:30px;margin-top:-3px;" src="{{$smarty.const.__PUB__}}admin/index.php?app=Public&act=getVerifyCode" id="verifyCodeImg" onClick="this.src+='&' + Math.random();" align="top" class="verifycodeimg" title="点击刷新"></span>
	</div>
	<button type="button" onClick="login();" class="btn btn-block btn-large btn-success" style="font-size:16px;">登　录</button>
	<div class="message error" style="" id="msg"></div>
</form>

</body>
</html>